//
//  SpecColorDataModel.m
//  HAODE
//
//  Created by LiYinDi on 16/3/18.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "SpecColorDataModel.h"
#import "SpecSizeDataModel.h"

@implementation SpecColorDataModel
+(instancetype)dataModelWithDict:(NSDictionary *)dict
{
    SpecColorDataModel *dataModel=[[self alloc] init];
    dataModel.specInv=[NSString stringWithFormat:@"%@",dict[@"specInv"]];
    dataModel.specPrice=[NSString stringWithFormat:@"%@",dict[@"specPrice"]];
    dataModel.specId=[NSString stringWithFormat:@"%@",dict[@"specId"]];
    dataModel.colourId=[NSString stringWithFormat:@"%@",dict[@"colourId"]];
    dataModel.colourName=[NSString stringWithFormat:@"%@",dict[@"colourName"]];
    NSMutableArray *array=[NSMutableArray array];
    NSArray *sizeArray=dict[@"itemSize"];
   
    
    if (sizeArray.count>0) {
   
    for (NSDictionary *sizeDic in sizeArray)
    {
        SpecSizeDataModel *imgModel=[SpecSizeDataModel dataModelWithDict:sizeDic];
        
        
        [ array addObject:imgModel];
        
    }
        
    }
    dataModel.sizeModelArray=array;
    return dataModel;
}

@end
